package topt_12z.logging;

import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.LogRecord;

import topt_12z.gui.MainFrame;

public class TextAreaHandler extends Handler {
	private MainFrame output;
	
	public TextAreaHandler(MainFrame frame) {
		output = frame;
	}
	
	@Override
	public void close() throws SecurityException {
		
	}

	@Override
	public void flush() {
		
	}

	@Override
	public void publish(LogRecord record) {
		if(record.getLevel() == Level.INFO){
			output.logMessage(record.getMessage());
		}
		
	}

}
